<template>
    <div class="tousu bg">
      <div class="tousuWrap">
        <div class="iptWrap bgw">
          <textarea placeholder="意见建议..." v-model="feed.desc"></textarea> 
          <a @click="doSubmit" class="submit btn2">发布</a>
        </div>
        <div class="desc bgw">
          客服电话 ：400-1234-1234
        </div>
      </div>
    </div>
</template>
<script type="text/babel">
  import {submit} from '../factory/feedback';
  export default {
    name: 'feedback',
    components: {
      vfooter: require('../components/vfooter')
    },
    data () {
      return {
        feed: {
          desc: ''
        }
      };
    },
    created () {
      // let that = this;
      this.$dispatch('alert.close');
    },
    methods: {
      doSubmit () {
        let that = this;
        submit().then(res => {
          if (!res.iserror) {
            that.$dispatch('alert', '感谢您宝贵的建议~', () => {
              that.$router.go({name: 'uc'});
            });
          }
        });
      }
    }
  };
</script>
